Last updated by: bg-11, Last updated on: 16/05/2025
Wazuh Docker Upgrade Guide (While Preserving Existing Configurations)
Document Creation: 05 May, 2025. Last Edited: 05 May, 2025. Authors: Bikendra Gurung.
Effective Date: 05 May, 2025. Expiry Date: 05 May, 2026.
Overview
This technical guide provides step-by-step instructions to safely upgrade Wazuh Docker to the latest version while preserving existing configurations and data.
Prerequisites
- Existing Wazuh Docker deployment – This guide assumes the Wazuh stack (Manager, Indexer, Dashboard, Agent) is already deployed using Docker.
- Admin/Root access to the Wazuh Docker host (Linux server).
- Familiarity with docker, docker-compose, and basic Linux operations.
- Backup of existing docker-compose.yml and config/ directory.
- Docker volumes must not be deleted to preserve data.
- The following needs to be installed:
- Docker
- docker-compose
- git
Important Note
If the docker-compose
command does not work on your system, use docker compose
instead (without a hyphen).
Upgrade Steps
Step 1: Backup
-
Check for running Wazuh containers.
docker ps
-
Find the active 'docker-compose.yml' path by checking a Wazuh container (e.g., indexer)
docker inspect 'single-node_wazuh.indexer_1' | grep -i compose
-
Backup current configuration
cd /path/to/wazuh-docker/...
cp docker-compose.yml docker-compose.yml.backup
cp -r config/ config_backup/
Step 2: Stop Containers (Preserves Volumes)
docker-compose down
Step 3: Download New Wazuh Docker Files
-
Fetch updates
git fetch --all
-
Check the Wazuh website and identify the latest stable Wazuh version (in this case, 4.11.2). Checkout that version.
git checkout v4.11.2
Step 4: Compare and Merge Changes
-
Restore the old docker-compose.yml backed up in 'Step 1':
rm docker-compose.yml
cp docker-compose.yml.backup docker-compose.yml -
Ensure the following in the
single-node/docker-compose.yml
file:2.1. Ensure the image versions correspond to the current deployment (e.g., v4.11.2).
services:
wazuh.manager:
image: wazuh/wazuh-manager:4.11.2
wazuh.indexer:
image: wazuh/wazuh-indexer:4.11.2
wazuh.dashboard:
image: wazuh/wazuh-dashboard:4.11.2
2.2. Modify the
OPENSEARCH_JAVA_OPTS
environment variable to allocate more RAM to the Wazuh indexer container (if needed).OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g
-
Update the defaultRoute parameter in the Wazuh dashboard configuration file
single-node/config/wazuh_dashboard/opensearch_dashboards.yml
is set to the value below (if needed).uiSettings.overrides.defaultRoute: /app/wz-home
-
Modify the tag of image generator (if needed).
single-node/generate-indexer-certs.yml
services:
generator:
image: wazuh/wazuh-certs-generator:0.0.2
-
Recreate the certificates:
docker-compose -f generate-indexer-certs.yml run --rm generator
-
Restore
wazuh_manager.conf
from backup:cd single-node/config/wazuh_cluster/
rm wazuh_manager.conf
cp ../../config_backup/wazuh_cluster/wazuh_manager.conf wazuh_manager.conf
Step 5: Start the New Version of Wazuh
docker compose up -d
Step 6: Post-Upgrade Validation
-
Check container health - ensure the containers are up and running:
docker ps
-
Access the Wazuh Dashboard and ensure the dashboard and indexer are functioning:
https://<your-dashboard-ip>/app/wz-home
- Example:
https://redback.it.deakin.edu.au/app/wz-home
-
If issues occur, check logs:
docker logs single-node_wazuh.dashboard_1
docker logs single-node_wazuh.indexer_1
docker logs single-node_wazuh.manager_1
Troubleshooting
Problem | Recommended Steps |
---|---|
Dashboard not loading | • Check wazuh.dashboard logs – docker logs single-node_wazuh.dashboard_1 |
Indexer failing | • Check Java memory settings and recreated certificates. • Check wazuh.indexer logs – docker logs single-node_wazuh.indexer_1 |
Manager not starting | • Verify wazuh_manager.conf syntax and permissions.• Check wazuh.manager logs – docker logs single-node_wazuh.manager_1 |
Certificates errors | • Rerun the certificate generator process (Step 4, point 5 – Recreate the certificates) |
Notes
- Always backup configuration files before proceeding.
docker-compose down
only stops/removes containers; data volumes are unaffected and preserved unless explicitly removed.- Some custom setups and integrations might need to be manually reconfigured after the upgrade.
- Always review Wazuh Release Notes for details on changes before upgrading.